{include file="public/head"/}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header"> 订单【{$info.id}】【{$info.order_sn}】{if $info['status']==2}修改发货{else}确认发货{/if}</div>
                <div class="layui-card-body" pad15>

                    <div class="layui-form" wid100 lay-filter="form">
                        <div class="layui-form-item">
                            <label class="layui-form-label">订单编号</label>
                            <div class="layui-input-inline">
                                <input type="text" name="id" readonly class="layui-input" autocomplete="off">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">订单单号</label>
                            <div class="layui-input-inline">
                                <input type="text" name="order_sn" readonly class="layui-input" autocomplete="off">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">收货人</label>
                            <div class="layui-input-inline">
                                <input type="text" name="send_name" readonly class="layui-input" autocomplete="off">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">收货人手机</label>
                            <div class="layui-input-inline">
                                <input type="text" name="send_mobile" readonly class="layui-input" autocomplete="off">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">收货地址</label>
                            <div class="layui-input-block">
                                <input type="text" name="send_address" readonly class="layui-input" autocomplete="off">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">快递公司</label>
                            <div class="layui-input-inline">
                                <select name="send_express_id" lay-verify="required" lay-search>
                                    <option value="">请选择快递公司</option>
                                    {volist name="express" id="vo"}
                                    {if $vo['status']==1}
                                    <option value="{$vo.id}">{$vo.title}</option>
                                    {/if}
                                    {/volist}
                                </select>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">快递单号</label>
                            <div class="layui-input-inline">
                                <input type="text" name="send_sn" placeholder="请输入快递单号" lay-verify="required" class="layui-input" autocomplete="off">
                            </div>
                        </div>

                        <div class="layui-form-item expire_time">
                            <label class="layui-form-label">发货时间</label>
                            <div class="layui-input-inline">
                                <input type="text" id="send_time" name="send_time" placeholder="发货时间" autocomplete="off" class="layui-input">
                            </div>
                            <div class="layui-form-mid layui-word-aux">从此时间开始达到设置自动收货天数，订单自动确认收货，留空默认当前时间</div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <input type="hidden" name="id">
                                <button class="layui-btn" lay-submit lay-filter="edit-btn">确认保存</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/foot"/}
<script>
    layui.config({
        base: '__LAYADMIN__/',
        version: 20220407
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','form','laydate'],function(){
        var $=layui.$,admin=layui.admin,form = layui.form,laydate=layui.laydate;
        form.val("form", {$info|raw});

        laydate.render({
            elem: '#send_time', //指定元素
            type: 'datetime'
        });

        //提交
        form.on('submit(edit-btn)', function (data) {
            admin.req({
                url: '{:url(\'Order/doSend\')}' //实际使用请改成服务端真实接口
                , type: 'post'
                , data: data.field
                , done: function (res) {
                    layer.msg(res.msg, {icon: 1, time: 1000}, function () {
                        parent.layer.closeAll("iframe");
                        //刷新父页面
                        parent.tableIn.reload();
                    });
                }
            });
        });

    });
</script>
</body>
</html>